package have_a_test;

public class LetterNumberThreadTest {
    public static void main(String[] args) {
        
        // 创建输出字母的线程
        Thread letterThread = new Thread(new LetterPrinter());
        // 创建输出数字的线程
        Thread numberThread = new Thread(new NumberPrinter());
        
        // 启动两个线程
        letterThread.start();
        numberThread.start();
    }
}

// 字母打印任务类
class LetterPrinter implements Runnable {
    @Override
    public void run() {
        for (char c = 'a'; c <= 'z'; c++) {
            System.out.print(c + " ");
        }
        System.out.println(); 
    }
}

// 数字打印任务类
class NumberPrinter implements Runnable {
    @Override
    public void run() {
        for (int i = 1; i <= 26; i++) {
            System.out.print(i + " ");
        }
        System.out.println(); 
    }
}